package com.sharein.auth.business;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class MySessionListener implements HttpSessionListener{

	@Override
	public void sessionCreated(HttpSessionEvent arg0) {
		System.out.println("Session created.");
	}

	@Override
	public void sessionDestroyed(HttpSessionEvent arg0) {
		HttpSession session = arg0.getSession();
		Object shareinIDObj = session.getAttribute("shareinID");
		if(shareinIDObj != null) UserManager.setUserSignedIn(shareinIDObj.toString(), false);
		System.out.println("Session destroyed.");
	}

}
